package com.cts.rt.service;

import java.util.List;

import javax.jws.WebService;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import com.cts.rt.model.Employee;

/**
 * Web Service interface so hierarchy of Generic Manager isn't carried through.
 */
@WebService
@Path("/employees")
public interface EmployeeService {
	/**
	 * Retrieves a user by userId. An exception is thrown if user not found
	 * 
	 * @param userId
	 *            the identifier for the user
	 * @return User
	 */
	@GET
	@Path("{id}")
	Employee getEmployee(@PathParam("id") String employeeId);

	/**
	 * Finds a user by their username.
	 * 
	 * @param username
	 *            the user's username used to login
	 * @return User a populated user object
	 */
	Employee getUserByUsername(@PathParam("username") String username);

	/**
	 * Retrieves a list of all users.
	 * 
	 * @return List
	 */
	@GET
	List<Employee> getEmployees();

	/**
	 * Saves a user's information
	 * 
	 * @param user
	 *            the user's information
	 * @return updated user
	 * @throws UserExistsException
	 *             thrown when user already exists
	 */
	@POST
	Employee saveEmployee(Employee employee) throws UserExistsException;

	/**
	 * Removes a user from the database by their userId
	 * 
	 * @param userId
	 *            the user's id
	 */
	@DELETE
	void removeEmployee(String employeeId);
}
